#ifndef X16_H
#define X16_H


#include "common.h"

// Line segment
template <AllegroVersion version>
struct x16
{
    uint32_t t;
    uint32_t k;

    uint32_t next;
    uint32_t parent;

    // Some bit mask?
    uint32_t bitmask;
#if __cplusplus >= 202002L
    COND_FIELD(version >= A_172, uint32_t, un);
#endif
    uint32_t width;
    int32_t coords[4];

    uint32_t TAIL;
    operator x16<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};

#if __cplusplus < 202002L
template <> struct x16<A_172>
{
    uint32_t t;
    uint32_t k;

    uint32_t next;
    uint32_t parent;

    // Some bit mask?
    uint32_t bitmask;

    uint32_t un;

    uint32_t width;
    int32_t coords[4];

    uint32_t TAIL;
    operator x16<A_174>() const;
    static constexpr AllegroVersion versions[1] = {A_172};
};
template <> struct x16<A_174> : x16<A_172> {};
#endif

#endif // X16_H
